<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h2>数据列表</h2>
<a href="${pageContext.request.contextPath}#">添加用户</a>
<div align="center" >
    <table border="1" width="90%">
        <tr align="center">
            <th>序号</th>
            <th>用户名称</th>
            <th>用户密码</th>
            <th>性别</th>
            <th>生日</th>
            <th>注册时间</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${userlist}" var="user">
            <tr align="center">
                <td>${user.id}</td>
                <td>${user.name}</td>
                <td>${user.password}</td>
                <td>${user.sex}</td>
                <td><fmt:formatDate value="${user.birthday}" pattern="yyyy-MM-dd"/></td>
                <td><fmt:formatDate value="${user.registTime}" pattern="yyyy-MM-dd"/></td>
                <td>
                    <a href="${pageContext.request.contextPath}#">修改</a>
                    <c:url var="deleteurl" value="/user/delect">
                        <c:param name="id" value="${user.id}"></c:param>
                    </c:url>
                    <a onclick="return confirm('确定删除用户吗?')" href="${deleteurl}">删除</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>

</div>
</body>
</html>
